package deng.qiya.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class ConnectivityManagerUtil {

	//check network connectivity
	public static boolean isConnected(Context context){
		ConnectivityManager connectivity = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo networkInfo = connectivity.getActiveNetworkInfo();
		if(networkInfo != null){
			return networkInfo.isAvailable();
		}
		else{
			return false;
		}
	}
}
